﻿using OpenAI;
using System;
using System.ClientModel;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AI.Common
{
    internal class AIFactory
    {
        internal static readonly string ApiKeyCredential = "sk-aJPuHxJbJ4aP0MVwYeTZTwomARkRGlE3oItaDA6VJhPajx3k";

        internal static readonly Uri ApiEndpoint = new Uri("https://oneapi.int.rclabenv.com/v1");

        internal static OpenAIClient CreateOpenAiClient()
        {
            ApiKeyCredential apiKeyCredential = new ApiKeyCredential(ApiKeyCredential);
            OpenAIClientOptions openAIClientOptions = new OpenAIClientOptions()
            {
                Endpoint = ApiEndpoint
            };
            OpenAIClient openAIClient =
                new OpenAIClient(apiKeyCredential, openAIClientOptions);
            return openAIClient;
        }
    }
}